﻿@model OT.Areas.Admin.Models.Questions
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i></button>
        <h3 id="myModalLabel">Delete Question</h3>
    </div>
    <div>
        <div class="modal-body">
            <div class="row-fluid">
                <div class="control-group">
                    @Html.HiddenFor(model => model.QuestionID, new { id = "HDFID" })
                    Do you want to delete this Question?
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-danger" type="submit" id="btnDelete"><i class="icon-trash icon-white"></i>Delete</button>
            <button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-off"></i>Cancel</button>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#btnDelete").click( function (e) {
        var QuestionID = $("#HDFID").val();
        e.preventDefault();
        $.ajax({
            url: "/Instructor/Question/Delete?QuestionID=" + QuestionID + "&IsDelete=" + "True",
            type: "POST",
            success: function (result) {
                if (result != "NotValid") {
                    $('#modalDiv').modal('hide');
                    showMsg('divMsgIndex', 'Sucessfully Deleted.', 'success');
                    loadPage(1, 10, '');
                }
            },
            error: function (data) {
            }
        });
        return false;
    });
</script>